<?php

Class IEDriver {

    private $handle;

    function __construct() {
        $this->handle = new COM('InternetExplorer.Application') or die("Unable to instanciate IE");
        $this->handle->Visible = true;
        $this->FullScreen = True;
        $this->window = $this->handle->HWND;
    }

    function navigate($url) {
        $this->handle->Navigate($url);
        while ($this->handle->Busy) {
            com_message_pump(4000);
        }
    }

    function takeScreenshot($filename) {
        $img = imagegrabwindow($this->window, 0);
        imagepng($img, $filename);
    }

    function quitIE() {
        $this->handle->Quit();
    }

    function displayIEInfo() {
        com_print_typeinfo($this->handle,'IWebBrowser2');
       // get_object_vars($this->handle);
       // get_class_methods($this->handle);
        /*
        function QueryInterface(

	function AddRef(

	function Release(

	function GetTypeInfoCount(

	function GetTypeInfo(

	function GetIDsOfNames(

	function Invoke(

	function GoBack(

	function GoForward(

	function GoHome(

	function GoSearch(

	function Navigate(

	function Refresh(

	function Refresh2(

         */
    }

}

$newie = new IEDriver();
$newie->navigate("http://www.westworld.be");
//$newie->takeScreenshot("mypng.png");
$newie->displayIEInfo();
$newie->quitIE();
?>